/* GUI CONVERTED from rprsrp02.p (converter v1.75) Mon Oct 23 21:05:00 2000 */
/* rprsrp02.p - RESOURCE LOAD DETAIL REPORT                             */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/*F0PN*/ /*K1DJ*/
/*V8:ConvertMode=FullGUIReport                                 */
/* REVISION: 1.0     LAST MODIFIED: 05/12/86    BY: pml         */
/* REVISION: 1.0     LAST MODIFIED: 05/14/86    BY: emb         */
/* REVISION: 1.0     LAST MODIFIED: 09/16/86    BY: emb *12*        */
/* REVISION: 2.0     LAST MODIFIED: 01/06/88    BY: pml *A125*      */
/* REVISION: 4.0     LAST MODIFIED: 02/24/88    BY: wug *A175*      */
/* REVISION: 4.0     LAST MODIFIED: 03/23/88    BY: rl  *A171*      */
/* REVISION: 4.0     LAST MODIFIED: 06/20/89    BY: emb *A748*      */
/* REVISION: 5.0     LAST MODIFIED: 06/20/89    BY: ftb *B422*      */
/* REVISION: 5.0     LAST MODIFIED: 02/22/90    BY: wug *B582*      */
/* REVISION: 4.0     LAST MODIFIED: 02/22/90    BY: wug *B583*      */
/* REVISION: 5.0     LAST MODIFIED: 04/04/90    BY: ram *B640*      */
/* REVISION: 6.0     LAST MODIFIED: 04/10/90    BY: ram *D018*      */
/* REVISION: 5.0     LAST MODIFIED: 09/27/90    BY: ram *B793*      */
/* REVISION: 7.0     LAST MODIFIED: 10/11/91    BY: emb *F024*      */
/* REVISION: 7.3     LAST MODIFIED: 10/23/92    BY: ram *G231*      */
/* REVISION: 7.3     LAST MODIFIED: 10/18/94    BY: jzs *GN61*      */
/* REVISION: 8.6     LAST MODIFIED: 12/11/97    BY: bvm *K1DJ*      */

/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan   */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KP* myb              */
/* REVISION: 9.1      LAST MODIFIED: 10/23/00   BY: *N0T0* Katie Hilbert    */

/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

/*GN61*/ {mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */

/*N0T0***BEGIN DELETE
 * &SCOPED-DEFINE rprsrp02_p_1 "Day/Week/Month"
 * /* MaxLen: Comment: */
 *N0T0***END DELETE*/

&SCOPED-DEFINE rprsrp02_p_2 "Per Column"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

     define new shared variable start like rq_start.
     define new shared variable dwm as character
/*N0T0*        format "!" label {&rprsrp02_p_1}.   */
/*N0T0*/format "!(1)" label "D/W/M/P".
     define new shared variable idays as integer
        format ">>>>>9" label {&rprsrp02_p_2}.
     define new shared variable rsc like rs_rsc.
     define new shared variable rsc1 like rs_rsc.

     define new shared variable site like rs_site.
     define new shared variable site1 like rs_site.

/*GN61 moved 1st column from 15 to 25 in frame a. (jzs) */
     
/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
        
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
site           colon 25
        site1          label {t001.i} colon 49
        rsc            colon 25
        rsc1           label {t001.i} colon 49 skip (1)
        start          colon 25 skip
        dwm            colon 25 skip
        idays          colon 25 skip
      SKIP(.4)  /*GUI*/
with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



     /* SET EXTERNAL LABELS */
     setFrameLabels(frame a:handle).

     view frame a.
     find shop_cal where shop_site = ""
     and shop_wkctr = "" and shop_mch = "" no-lock no-error.
     if not available shop_cal then do:
        {mfmsg.i 410 4}
        /* "DEFAULT SHOP CALENDAR DOES NOT EXIST" */
/*K1DJ*/    if c-application-mode <> 'web' then
             pause.
        undo.
     end.

     site = global_site.
     site1 = global_site.

/*K1DJ*/ {wbrp01.i}

         
/*GUI*/ {mfguirpa.i true  "printer" 132 }

/*GUI repeat : */
/*GUI*/ procedure p-enable-ui:

/*GN61      do: */
           if start = ? then start = today.
           if dwm = "" then dwm = "W".
           if idays = 0 or idays = ? then idays = 1.

           if site1 = hi_char then site1 = "".
           if rsc1 = hi_char then rsc1 = "".

/*K1DJ*/       if c-application-mode <> 'web' then
               
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


/*K1DJ*/ {wbrp06.i &command = update &fields = "  site site1 rsc rsc1 start
          dwm idays" &frm = "a"}

/*K1DJ*/ if (c-application-mode <> 'web') or
/*K1DJ*/ (c-application-mode = 'web' and
/*K1DJ*/ (c-web-request begins 'data')) then do:

/*GN61 - moved section above bcdparm'ing */
           if start < today then do:
          {mfmsg.i 15 2} /* WARNING: START DATE IS BEFORE TODAY */
           end.

           bcdparm = "".
           {mfquoter.i site   }
           {mfquoter.i site1  }
           {mfquoter.i rsc    }
           {mfquoter.i rsc1   }
           {mfquoter.i start  }
           {mfquoter.i dwm    }
           {mfquoter.i idays  }

           if rsc1 = "" then rsc1 = hi_char.
           if site1 = "" then site1 = hi_char.

/*GN61*/       if index("dwmp",dwm) = 0 then do:
/*N0T0*          {mfmsg.i 14 3}        */
                  /* INTERVAL MUST BE (D)ay (W)eek (M)onth OR (P)eriod */
/*N0T0*/          {pxmsg.i &MSGNUM=170 &ERRORLEVEL=3}
/*K1DJ*/        if c-application-mode = 'web' then return.
                else /*GUI NEXT-PROMPT removed */
          /*GUI UNDO removed */ RETURN ERROR.
/*GN61*/       end.

/*GN61      end.*/

/*K1DJ*/ end.

        /* SELECT PRINTER */
            
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i  "printer" 132}
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:
find shop_cal where shop_site = ""
     and shop_wkctr = "" and shop_mch = "" no-lock no-error.



        {mfphead.i}

        {gprun.i ""rprsrp2a.p""}

        /* REPORT TRAILER */
        
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/


     end.

/*K1DJ*/ {wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" site site1 rsc rsc1 start dwm idays "} /*Drive the Report*/
